package com.zzyy.study.config;

import com.zzyy.study.entities.OperationLogVo;
import com.zzyy.study.service.impl.OperationLogService;
import com.zzyy.study.utils.SpringUtils;
import java.util.TimerTask;
/**
 * @auther zzyy
 * @create 2024-02-17 16:51
 */

public class AsyncFactory {

    /**
     * 记录操作日志
     * @param operationLog 操作日志信息
     * @return 任务task
     */
    public static TimerTask recordOperation(OperationLogVo operationLog)
    {
        return new TimerTask() {
            @Override
            public void run() {
                SpringUtils.getBean(OperationLogService.class).saveOperationLog(operationLog);
            }
        };
    }


}

